Chapter 8: Hypothesis Testing for Population Proportions

COR 142 C

Author

Dr. Kao

Section 8.1. Introduction to Hypothesis Testing

TipThe ✋ Game

Let’s play a game of coin toss. To make the game more interesting, let’s set the following simple rule:

  • If the coin lands , you get to slap me.
  • If the coin lands , I get to slap you.

If the coin is tossed 10 times, how often do you expect to be slapped?

What is your first reaction if the following event happens when the coin is tossed 10 times?

How would you go about proving your claim?

Disclaimer: No actual slapping will occur in COR 142 C. This is a hypothetical game for educational purposes only.

TipAre You Full of 💩?

The person sits next to you in COR 142 C claims that they are basically an influencer at Flagler because their TikTok videos was getting way more likes than the average user.

Naturally, you are pretty skeptical of your neighbor’s claim. How would you go about calling them out on their 💩?

We all like to prove people wrong, right? But how do we do that in a systematically to make sure that we are using data and logic rather than just our gut feelings? This is where hypothesis testing comes in!

In its broadest sense, hypothesis testing is a method of making decisions (like deciding whether the coin rigged and your neighbor full of 💩) using data. These decisions are made by comparing what we actually observe with what we would expect to find if a specific hypothesis (a fancy word for assumption) were true.

When you hear people use the catch phrase data-driven decision-making, they are often referring to hypothesis testing.

In every hypothesis test, we have two competing scenarios: A scenario where how things should be in a normal, ideal world where everything is fair, and second scenario where things are different from the ideal world. The normal, ideal world scenario is called the null hypothesis (denoted by the symbol \(H_0\)), while the alternative scenario is called the alternative hypothesis (denoted by the symbol \(H_a\)).

TipThe ✋ Game, Revisited

In the ✋ game, we suspected that the coin is an unfair one. In an normal, ideal world, we expect the proportion of a coin landing on tails to be \(0.5\). An unfair coin would have a proportion of tails different from \(0.5\).

We can symbolically represent our two competing scenarios as follows: Let \(p\) be the proportion of tails when the coin is tossed.

  • Null hypothesis: \(H_0: p = 0.5\)
  • Alternative hypothesis: \(H_a: p \ne 0.5\)

Let’s take a moment to look at the alternative hypothesis. Saying that \(p \ne 0.5\) means that the proportion of tails is not \(0.5\). This means that \(p\) is either greater than \(0.5\) (\(p > 0.5\)), or \(p\) is less than \(0.5\) (\(p < 0.5\)).

\(p \ne 0.5\) doesn’t quite fit the scenario from the ✋ game, because no one would forget being slapped in the face 9 consecutive times. In this case, our suspicion is that the coin lands on tails more often than expected.

So, the appropriate alternative hypothesis should be \(p > 0.5\).

Let’s reframe the alternative hypothesis to better reflect the scenario from the ✋ game:

  • \(H_0: p = 0.5\)
  • \(H_a: p > 0.5\)
TipExample 8.1.1.

Suppose the proportion of all Flagler students who eat at DHall at least once a day was 60% last school year. The DHall service provider, Aramark, wants to know whether this proportion has changed this year. Help the manager formulate the null and alternative hypotheses for hypothesis testing.

The proportion from last year is \(p = 0.6\), which serves as the null hypothesis. The question we want to answer is whether this proportion has changed. In other words, \(p \ne 0.6\). Therefore, the hypotheses are:

  • \(H_0: p = 0.6\)
  • \(H_a: p \ne 0.6\)
TipExample 8.1.2.

According to a 2015 survey by the University of Michigan, 71.5% of high school seniors in the U.S. had a driver’s license. A sociologist believes that this rate has declined. A sample of 500 randomly selected high school seniors finds that 350 of them had a driver’s license.

What are the null and alternative hypotheses for testing the sociologist’s claim?

The proportion from the 2015 survey is \(p = 0.715\), which serves as the null hypothesis. The sociologist believes that this rate has declined, which means that \(p < 0.715\). Therefore, the hypotheses are:

  • \(H_0: p = 0.715\)
  • \(H_a: p < 0.715\)

From the above few examples, we can see that the null hypothesis is always an equality statement (e.g., \(p = 0.5\), \(p = 0.6\), \(p = 0.715\)), while the alternative hypothesis is always an inequality statement (e.g., \(p \ne 0.5\), \(p > 0.5\), \(p < 0.715\)).

Important
  • The null hypothesis always contains an equality sign (“\(=\)”).
  • An alternative hypothesis with a “\(<\)” or “\(>\)” is called a one-sided hypothesis or one-tailed hypothesis.
  • An alternative hypothesis with a “\(\ne\)” is called a two-sided hypothesis or two-tailed hypothesis.
  • We use \(p_0\) to denote the hypothesized population proportion under the null hypothesis.
Two-Sided One-Sided (Left) One-Sided (Right)
Null Hypothesis \(H_0: p = p_0\) \(H_0: p = p_0\) \(H_0: p = p_0\)
Alternative Hypothesis \(H_a: p \ne p_0\) \(H_a: p < p_0\) \(H_a: p > p_0\)

Section 8.2. The Machinery of Hypothesis Testing

With motivation and a good sense of how to formulate our hypotheses under our belt, we can now proceed to the actual mechanics of hypothesis testing. Let’s motivate the process with an example.

TipThe ✋ Game, Revisited, Again.

Is the event impossible?

If the event is not impossible, how likely is it to happen?

Question 5 gave us all the main ideas behind the machinery of hypothesis testing! Let’s unpack Question 5 and examine it more closely (in the form of more questions).

What is the underlying assumption we were making in Question 5?

Did Question 5 implicitly give us instructions on how to go about performing hypothesis testing?

Question 5 provides a framework for the computation portion of hypothesis testing. Let’s summarize the steps below:

ImportantComputation Stage of Hypothesis Testing
  1. We assume the null hypothesis \(H_0\) is true.
  2. We calculate the likelihood of observing the data we actually observed (or something more extreme) under the assumption that \(H_0\) is true. This likelihood is called the \(p\)-value.

We will circle back to exactly which calculations are required during this stage later. For now, our hypothesis testing workflow looks like this:

flowchart TD

A(Formulate Hypotheses) --> B[Computation Stage]